package com.globallogic.strelchuk.multi.entity;

import com.globallogic.strelchuk.multi.util.Multiplicator;

/**
 * @author olena.strelchuk
 */

/**
 * Row for Triangle Multiplication Table
 */
public class Row {

	private int rowSize;

	private int multiplyValue;

	private int[] rowArray;

	public Row(int rowSize, int multiplyValue) {
		this.rowSize = rowSize;
		this.multiplyValue = multiplyValue;
		rowArray = new int[getRowSize()];
		fillRowValues();
	}

	/**
	 * Generate Row values with specified size
	 */
	private void fillRowValues() {

		for (int i = 1; i <= rowSize; i++) {
			rowArray[i - 1] = Multiplicator.doMultiply(multiplyValue, i);
		}
	}

	public int getRowSize() {
		return rowSize;
	}

	public int[] getRowArray() {
		return rowArray;
	}
}
